using System;
using HR60_PanelSoft.Model;

namespace HR60_PanelSoft.Service
{
	public class DeviceGroupService : CommonService
	{
		// 保存
		public static void save(DeviceGroup source, DeviceGroup dto)
		{
			source.name = dto.name;
		}
		
		// 添加
		public static void append(DeviceGroup group)
		{
			proj.deviceGroups.Add (group);
		}

		// 删除
		public static void remove(DeviceGroup group)
		{
			// 删除下辖的设备
			for (int i=0; i<group.devices.Count; i++)
			{
				DeviceService.remove (group.devices [i]);
			}
			proj.deviceGroups.Remove (group);
		}
	}
}

